#pragma once
#include <qbprotocol/include/SSQBModel.h>

#include <QColor>
#include <QFont>
#include <QPainter>
#include <QRect>
#include <QString>
#include <QWidget>

#include "AIPanelBase.h"
#include "core/ImageMgr.h"
#include "core/StyleMgr.h"

class CAIPanelInfo : public CAIPanelBase {
  Q_OBJECT
 public:
  CAIPanelInfo();
  ~CAIPanelInfo();

  void SetServicePlatform(xQBServicePlatformManagerAck_c* pAck);

  virtual void Init();
  void Draw(QPainter* painter, int top);
  void DrawButton(QPainter* painter, QString& szTitle, QRect& R);
  void DrawTextWithBKColor(QPainter* painter, QString text, QFont font,
                           const QRect& rt, QColor txtColor, int padding,
                           int radius, QColor bkColor);
  void SetRect(QRect rct) { m_rct = rct; }

 protected:
  int m_nTelNum;
  int m_nMobileNum;

  SImage* m_imgUser;
  SImage* m_imgMobile;
  SImage* m_imgEmail;

  QRect m_rcPwd;
  QRect m_rcMemeberInfo;
  QRect m_rcVerify;  // 手机
  int m_nMousePos;
  int m_nMouseDown;
  QRect m_rct;
  QPushButton* m_ChangePwd;
  QPushButton* m_Checkphone;

  xQBServicePlatformManagerAck_c m_ServicePlatfrom;

  void paintEvent(QPaintEvent* event) override;
  virtual void mousePressEvent(QMouseEvent* event) override;
  virtual void mouseMoveEvent(QMouseEvent* event) override;
  void resizeEvent(QResizeEvent* event);
  void CreateButton(QString ButtonName1, QString ButtonName2);
  void ClickChangePwd();
  void ClickCheckPhone();
};
